package com.zpark.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zpark.entity.patients.WesternDiagnosisRecords;
import com.zpark.mapper.WesternDiagnosisRecordsMapper;
import com.zpark.service.WesternDiagnosisRecordsService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WesternDiagnosisRecordsServiceImpl extends ServiceImpl<WesternDiagnosisRecordsMapper, WesternDiagnosisRecords>
    implements WesternDiagnosisRecordsService {

    @Override
    public List<WesternDiagnosisRecords> getAllRecords() {
        return this.list();
    }

    @Override
    public List<WesternDiagnosisRecords> getRecordsByPatientId(Long patientId) {
        QueryWrapper<WesternDiagnosisRecords> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("patient_id", patientId);
        return this.list(queryWrapper);
    }
}